

function addformtexteditor()
{

   
    $("#addform").append('<div id="feature'+rowdiv+'" class="itPlg addTxtPlg featureclass texteditorsetform">'+dataform['texteditor']+"</div>");
    var rownow=rowdiv;

   
    $('#feature'+rownow+' textarea[name="texteditor[]"]').sceditor({
plugins: "xhtml",
toolbar: "bold,italic,underline|left,center,right|bulletlist,orderedlist,link",
style: "/js/vendor/minified/jquery.sceditor.default.min.css",
emoticonsRoot :'/'
});
   
   $('#feature'+rownow+' .deleterowbutton').click(function(){
   
    $('#feature'+rownow).remove();
    
   });
  
  
    
    
    
    
    rowdiv++;

}
function saveformtexteditor(id,plugid)
{
   var obj={};
   obj={plugid:plugid,text:$("#"+id+' textarea[name="texteditor[]"]').sceditor('instance').val()};
   
   return obj;


}
function getformtexteditor(dataplugin)
{
if(dataplugin.text)
{
var code = '<div class="ldIt wrpTxtLd clBg4">\n';
code += '<p>'+dataplugin.html+'</p>\n';
code += '</div>';
}else
{
var code="";

}
return code;


}
 function editformtexteditor(datarow)
 {
   addformtexteditor();
    var rownow= rowdiv-1;
     $('#feature'+rownow+'  textarea[name="texteditor[]"]').sceditor('instance').val(datarow.text);
  
 }